package com.mars.admin.modules.goods.entity;

import com.mars.admin.modules.base.entity.BaseEntity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品SKU实体
 *
 * @author Mars
 * @version 1.0
 * @date 2025-01-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("tb_goods_sku")
@Schema(description = "商品SKU")
public class GoodsSku extends BaseEntity {

    /**
     * SKU ID
     */
    @Id(keyType = KeyType.Auto)
    @Schema(description = "SKU ID", example = "1")
    private Long id;

    /**
     * 商品ID
     */
    @Schema(description = "商品ID", example = "1")
    private Long goodsId;

    /**
     * SKU编码
     */
    @Schema(description = "SKU编码", example = "BACKPACK_001_BLACK")
    private String skuCode;

    /**
     * SKU名称
     */
    @Schema(description = "SKU名称", example = "户外防水背包-黑色")
    private String skuName;

    /**
     * SKU图片
     */
    @Schema(description = "SKU图片", example = "https://example.com/sku.jpg")
    private String skuImage;

    /**
     * SKU属性，如：{"颜色":"红色","尺寸":"XL"}
     */
    @Schema(description = "SKU属性", example = "{\"颜色\":\"黑色\",\"尺寸\":\"L\"}")
    private String attributes;

    /**
     * 市场价
     */
    @Schema(description = "市场价", example = "299.00")
    private BigDecimal marketPrice;

    /**
     * 销售价
     */
    @Schema(description = "销售价", example = "199.00")
    private BigDecimal salePrice;

    /**
     * 成本价
     */
    @Schema(description = "成本价", example = "120.00")
    private BigDecimal costPrice;

    /**
     * 库存数量
     */
    @Schema(description = "库存数量", example = "50")
    private Integer stock;

    /**
     * 库存预警数量
     */
    @Schema(description = "库存预警数量", example = "10")
    private Integer warningStock;

    /**
     * 重量(kg)
     */
    @Schema(description = "重量", example = "1.5")
    private BigDecimal weight;

    /**
     * 体积(m³)
     */
    @Schema(description = "体积", example = "0.1")
    private BigDecimal volume;

    /**
     * 销量
     */
    @Schema(description = "销量", example = "45")
    private Integer salesCount;

    /**
     * 状态：0-禁用，1-正常
     */
    @Schema(description = "状态", example = "1")
    private Integer status;

}
